﻿<metro:MetroWindow x:Class="OnlineSoccerManager.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:converter="clr-namespace:OnlineSoccerManager.Converter"
        xmlns:helper="clr-namespace:OnlineSoccerManager.Helper"
        Title="Online Soccer Manager" Height="800" Width="1300" SnapsToDevicePixels="True" RenderOptions.ClearTypeHint="Enabled">
    <metro:MetroWindow.Resources>
        <converter:BoolVisibilityConverter x:Key="boolVisConv" />
        <converter:BoolInverseVisibilityConverter x:Key="boolNotVisConv" />
        <converter:EnumEqualsVisibilityConverter x:Key="enumEqualConv" />
        <converter:PositiveNegativeForegroundConverter x:Key="colorConv" />
        <converter:PositiveVisibilityConverter x:Key="posVisConv" />
        <converter:NegativeVisibilityConverter x:Key="negVisConv" />
        <converter:TranslatorConverter x:Key="translator" />
        <converter:MultiVisibilityConverter x:Key="multiVisConv" />
        <converter:NotNullVisibilityConverter x:Key="notNullVisConv" />
        <converter:NullVisibilityConverter x:Key="nullVisConv" />
    </metro:MetroWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="1" Text="{Binding LastError}" Visibility="{Binding HasError, Converter={StaticResource boolVisConv}}" Background="Red" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Stretch" TextWrapping="Wrap" TextAlignment="Center" Padding="10" FontWeight="Bold" Panel.ZIndex="200" />
        <Grid Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="#88000000"  Visibility="{Binding IsBusy, Converter={StaticResource boolVisConv}}" Panel.ZIndex="100">
            <metro:ProgressRing IsActive="True" />
        </Grid>
        <Grid Grid.Row="1" Panel.ZIndex="0" >
            
            <!-- LOGIN VIEW -->
            <Grid Visibility="{Binding CurrentState, Converter={StaticResource enumEqualConv}, ConverterParameter=Login}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="150"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="127*"/>
                    <RowDefinition Height="33"/>
                    <RowDefinition Height="33"/>
                    <RowDefinition Height="33"/>
                    <RowDefinition Height="98*"/>
                </Grid.RowDefinitions>
                <TextBlock HorizontalAlignment="Right"  Grid.Row="1" TextWrapping="Wrap" Text="Benutzername: " VerticalAlignment="Center" Margin="0,9" />
                <TextBlock HorizontalAlignment="Right"  Grid.Row="2" TextWrapping="Wrap" Text="Passwort: " VerticalAlignment="Center" Margin="0,9,0,8" />
                <TextBox Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,3,0,4" Height="23" Grid.Row="1" TextWrapping="Wrap" Text="{Binding UserName}" VerticalAlignment="Center" metro:TextboxHelper.Watermark="Benutzername" />
                <PasswordBox Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,4,0,3" Height="23" Grid.Row="2" helper:PasswordBoxHelper.Attach="True"  helper:PasswordBoxHelper.Password="{Binding Password, Mode=TwoWay}" VerticalAlignment="Center" metro:TextboxHelper.Watermark="Password" />
                <Button Grid.Column="1" Content="Login" HorizontalAlignment="Stretch" Margin="5,0,0,0" Grid.Row="3" VerticalAlignment="Center" Style="{DynamicResource SquareButtonStyle}" IsDefault="True" Command="{Binding LoginCommand}" />
            </Grid>
            
            <!-- HOME VIEW-->
            <Grid Visibility="{Binding CurrentState, Converter={StaticResource enumEqualConv}, ConverterParameter=Home}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="20" />
                </Grid.RowDefinitions>
                <metro:ProgressRing Grid.Row="1" IsActive="{Binding IsRefreshing}" />
                <TabControl Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <!-- MANNSCHAFT-->
                    <TabItem Header="Mannschaft">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <ListView Grid.Column="0" ItemsSource="{Binding ProfiKader}" SelectedItem="{Binding SelectedPlayer}">
                                <ListView.View>
                                    <GridView>
                                        <GridView.Columns>
                                            <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" Width="150" />
                                            <GridViewColumn Header="Position">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                                            <TextBlock Text="{Binding Position, StringFormat=N0}" />
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="Alter">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding Age, StringFormat=N0}" />
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="Stärke">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding Strength, StringFormat=N0}" />
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="Ein. Stärke">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding SingleStrength, StringFormat=N0}" />
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="Land" Width="80">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <Image Source="{Binding FlagSource}" Width="20" Margin="5" RenderOptions.BitmapScalingMode="HighQuality" />
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="EWS" Width="80">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <Image Source="{Binding EWSSource}" Width="20" Margin="5" RenderOptions.BitmapScalingMode="HighQuality" />
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="Wert" Width="80">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding Value, StringFormat=N0}" />
                                                            <TextBlock Text=" $" />
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="Treaty" Width="120">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding Treaty, StringFormat=N0}" />
                                                            <TextBlock Text=" ZAT" />
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="Allgemeine Skills" Width="120">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding Skill.Common.ChangeSummary}" BorderThickness="0">
                                                            <ItemsControl.ItemsPanel>
                                                                <ItemsPanelTemplate>
                                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" />
                                                                </ItemsPanelTemplate>
                                                            </ItemsControl.ItemsPanel>
                                                            <ItemsControl.ItemTemplate>
                                                                <DataTemplate>
                                                                    <Image Source="{Binding IconSource}" >
                                                                        <Image.ToolTip>
                                                                            <StackPanel Orientation="Horizontal">
                                                                                <TextBlock Text="{Binding Name}" />
                                                                                <TextBlock Text=": " />
                                                                                <TextBlock Text="{Binding Value}" />
                                                                            </StackPanel>
                                                                        </Image.ToolTip>
                                                                    </Image>
                                                                </DataTemplate>
                                                            </ItemsControl.ItemTemplate>
                                                        </ItemsControl>
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                            <GridViewColumn Header="Technische Skills" Width="120">
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding Skill.Technical.ChangeSummary}" BorderThickness="0">
                                                            <ItemsControl.ItemsPanel>
                                                                <ItemsPanelTemplate>
                                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" />
                                                                </ItemsPanelTemplate>
                                                            </ItemsControl.ItemsPanel>
                                                            <ItemsControl.ItemTemplate>
                                                                <DataTemplate>
                                                                    <Image Source="{Binding IconSource}" >
                                                                        <Image.ToolTip>
                                                                            <StackPanel Orientation="Horizontal">
                                                                                <TextBlock Text="{Binding Name}" />
                                                                                <TextBlock Text=": " />
                                                                                <TextBlock Text="{Binding Value}" />
                                                                            </StackPanel>
                                                                        </Image.ToolTip>
                                                                    </Image>
                                                                </DataTemplate>
                                                            </ItemsControl.ItemTemplate>
                                                        </ItemsControl>
                                                    </DataTemplate>
                                                </GridViewColumn.CellTemplate>
                                            </GridViewColumn>
                                        </GridView.Columns>
                                    </GridView>
                                </ListView.View>
                            </ListView>
                            <!--<GridSplitter Grid.Column="1"  VerticalAlignment="Stretch" Width="3" HorizontalAlignment="Left" IsEnabled="{Binding Path=IsChecked, ElementName=btnShowDetail, Converter={StaticResource boolVisConv}}" Visibility="{Binding Path=IsChecked, ElementName=btnShowDetail, Converter={StaticResource boolVisConv}}"/>-->
                            <StackPanel Grid.Column="1" Margin="3,0,0,0" Orientation="Horizontal" HorizontalAlignment="Stretch">
                                <Grid Margin="10,0,5,0" MinWidth="250" HorizontalAlignment="Stretch" Visibility="{Binding Path=IsChecked, ElementName=btnShowDetail, Converter={StaticResource boolVisConv}}" >
                                    <TextBlock  Text="{Binding [SelectPlayer], Source={x:Static helper:Translator.Instance}}" TextAlignment="Center" VerticalAlignment="Center" FontSize="14">
                                        <TextBlock.Visibility>
                                            <MultiBinding Converter="{StaticResource multiVisConv}">
                                                <Binding Path="IsChecked" ElementName="btnShowDetail" Converter="{StaticResource boolVisConv}" />
                                                <Binding Path="SelectedPlayer" Converter="{StaticResource nullVisConv}" />
                                            </MultiBinding>
                                        </TextBlock.Visibility>
                                    </TextBlock>
                                    <Grid>
                                        <Grid.Visibility>
                                            <MultiBinding Converter="{StaticResource multiVisConv}">
                                                <Binding Path="IsChecked" ElementName="btnShowDetail" Converter="{StaticResource boolVisConv}" />
                                                <Binding Path="SelectedPlayer" Converter="{StaticResource notNullVisConv}" />
                                            </MultiBinding>
                                        </Grid.Visibility>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                        
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                            <RowDefinition Height="20" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="120" />
                                            <ColumnDefinition Width="40" />
                                            <ColumnDefinition Width="40" />
                                            <ColumnDefinition Width="30" />
                                        </Grid.ColumnDefinitions>                                        
                                        <StackPanel Grid.Row="0" Grid.ColumnSpan="4" Orientation="Horizontal" Margin="0,10,0,10">
                                            <TextBlock Text="{Binding [TechnicalSkill], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"  FontSize="14" Margin="0,0,10,0"/>
                                            <ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding SelectedPlayer.Skill.Technical.ChangeSummary}" BorderThickness="0">
                                                <ItemsControl.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" />
                                                    </ItemsPanelTemplate>
                                                </ItemsControl.ItemsPanel>
                                                <ItemsControl.ItemTemplate>
                                                    <DataTemplate>
                                                        <Image Width="14" Height="14" Source="{Binding IconSource}" >
                                                            <Image.ToolTip>
                                                                <StackPanel Orientation="Horizontal">
                                                                    <TextBlock Text="{Binding Name, Converter={StaticResource translator}}" />
                                                                    <TextBlock Text=": " />
                                                                    <TextBlock Text="{Binding Value}" />
                                                                </StackPanel>
                                                            </Image.ToolTip>
                                                        </Image>
                                                    </DataTemplate>
                                                </ItemsControl.ItemTemplate>
                                            </ItemsControl>
                                        </StackPanel>
                                        
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding [Resistance], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="1" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Resistance, StringFormat=N2}" />
                                        <TextBlock Grid.Row="1" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.ResistanceChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.ResistanceChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="1" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.ResistanceChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="1" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.ResistanceChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding [Reliability], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="2" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Reliability, StringFormat=N2}" />
                                        <TextBlock Grid.Row="2" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.ReliabilityChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.ReliabilityChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="2" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.ReliabilityChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="2" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.ReliabilityChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding [Kick], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold" />
                                        <TextBlock Grid.Row="3" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Kick, StringFormat=N2}" />
                                        <TextBlock Grid.Row="3" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.KickChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.KickChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="3" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.KickChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="3" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.KickChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding [Pass], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="4" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Pass, StringFormat=N2}" />
                                        <TextBlock Grid.Row="4" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.PassChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.PassChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="4" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.PassChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="4" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.PassChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="5" Grid.Column="0" Text="{Binding [Header], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="5" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Header, StringFormat=N2}" />
                                        <TextBlock Grid.Row="5" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.HeaderChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.HeaderChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="5" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.HeaderChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="5" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.HeaderChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="6" Grid.Column="0" Text="{Binding [Duel], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="6" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Duel, StringFormat=N2}" />
                                        <TextBlock Grid.Row="6" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.DuelChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.DuelChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="6" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.DuelChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="6" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.DuelChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="7" Grid.Column="0" Text="{Binding [BallControl], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="7" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.BallControl, StringFormat=N2}" />
                                        <TextBlock Grid.Row="7" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.BallControlChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.BallControlChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="7" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.BallControlChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="7" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.BallControlChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="8" Grid.Column="0" Text="{Binding [Velocity], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="8" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Velocity, StringFormat=N2}" />
                                        <TextBlock Grid.Row="8" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.VelocityChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.VelocityChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="8" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.VelocityChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="8" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.VelocityChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="9" Grid.Column="0" Text="{Binding [Survey], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="9" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Survey, StringFormat=N2}" />
                                        <TextBlock Grid.Row="9" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.SurveyChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.SurveyChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="9" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.SurveyChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="9" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.SurveyChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="10" Grid.Column="0" Text="{Binding [Covering], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="10" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Covering, StringFormat=N2}" />
                                        <TextBlock Grid.Row="10" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.CoveringChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.CoveringChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="10" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.CoveringChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="10" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.CoveringChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="11" Grid.Column="0" Text="{Binding [Aggressivity], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="11" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Aggressivity, StringFormat=N2}" />
                                        <TextBlock Grid.Row="11" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.AggressivityChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.AggressivityChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="11" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.AggressivityChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="11" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.AggressivityChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="12" Grid.Column="0" Text="{Binding [Discipline], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="12" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.Discipline, StringFormat=N2}" />
                                        <TextBlock Grid.Row="12" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Technical.DisciplineChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Technical.DisciplineChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="12" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.DisciplineChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="12" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Technical.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Technical.DisciplineChange, Converter={StaticResource negVisConv}}" />

                                        <StackPanel Grid.Row="13" Grid.ColumnSpan="4" Orientation="Horizontal" Margin="0,10,0,10">
                                            <TextBlock Text="{Binding [CommonSkill], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"  FontSize="14" Margin="0,0,10,0"/>
                                            <ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding SelectedPlayer.Skill.Common.ChangeSummary}" BorderThickness="0">
                                                <ItemsControl.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" />
                                                    </ItemsPanelTemplate>
                                                </ItemsControl.ItemsPanel>
                                                <ItemsControl.ItemTemplate>
                                                    <DataTemplate>
                                                        <Image Width="14" Height="14" Source="{Binding IconSource}" >
                                                            <Image.ToolTip>
                                                                <StackPanel Orientation="Horizontal">
                                                                    <TextBlock Text="{Binding Name, Converter={StaticResource translator}}" />
                                                                    <TextBlock Text=": " />
                                                                    <TextBlock Text="{Binding Value}" />
                                                                </StackPanel>
                                                            </Image.ToolTip>
                                                        </Image>
                                                    </DataTemplate>
                                                </ItemsControl.ItemTemplate>
                                            </ItemsControl>
                                        </StackPanel>

                                        <TextBlock Grid.Row="14" Grid.Column="0" Text="{Binding [Endurance], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="14" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Common.Endurance, StringFormat=N2}" />
                                        <TextBlock Grid.Row="14" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Common.EnduranceChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Common.EnduranceChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="14" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Common.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Common.EnduranceChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="14" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Common.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Common.EnduranceChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="15" Grid.Column="0" Text="{Binding [Morale], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="15" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Common.Morale, StringFormat=N2}" />
                                        <TextBlock Grid.Row="15" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Common.MoraleChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Common.MoraleChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="15" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Common.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Common.MoraleChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="15" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Common.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Common.MoraleChange, Converter={StaticResource negVisConv}}" />

                                        <TextBlock Grid.Row="16" Grid.Column="0" Text="{Binding [Fitness], Source={x:Static helper:Translator.Instance}}" FontWeight="Bold"/>
                                        <TextBlock Grid.Row="16" Grid.Column="1" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Common.Fitness, StringFormat=N2}" />
                                        <TextBlock Grid.Row="16" Grid.Column="2" TextAlignment="Right" Text="{Binding SelectedPlayer.Skill.Common.FitnessChange, StringFormat=N2}" Foreground="{Binding SelectedPlayer.Skill.Common.FitnessChange, Converter={StaticResource colorConv}}" />
                                        <Image Grid.Row="16" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Common.ChangeUpSource}" Visibility="{Binding SelectedPlayer.Skill.Common.FitnessChange, Converter={StaticResource posVisConv}}" />
                                        <Image Grid.Row="16" Grid.Column="3" Width="14" Height="14" Source="{Binding SelectedPlayer.Skill.Common.ChangeDownSource}" Visibility="{Binding SelectedPlayer.Skill.Common.FitnessChange, Converter={StaticResource negVisConv}}" />

                                    </Grid>
                                </Grid>
                                <ToggleButton x:Name="btnShowDetail" Width="36" Height="35" Margin="0, 10, 0, 0" HorizontalAlignment="Right" VerticalAlignment="Top" Style="{DynamicResource MetroCircleToggleButtonStyle}">
                                    <Grid>
                                        <Rectangle Width="14" Height="14" Fill="White" Visibility="{Binding Path=IsChecked, ElementName=btnShowDetail, Converter={StaticResource boolVisConv}}">
                                            <Rectangle.OpacityMask>
                                                <VisualBrush Stretch="Fill" Visual="{DynamicResource appbar_book_list}"/>
                                            </Rectangle.OpacityMask>
                                        </Rectangle>
                                        <Rectangle Width="14" Height="14" Fill="Gray" Visibility="{Binding Path=IsChecked, ElementName=btnShowDetail, Converter={StaticResource boolNotVisConv}}">
                                            <Rectangle.OpacityMask>
                                                <VisualBrush Stretch="Fill" Visual="{DynamicResource appbar_book_list}"/>
                                            </Rectangle.OpacityMask>
                                        </Rectangle>
                                    </Grid>
                                </ToggleButton>
                            </StackPanel>
                        </Grid>
                    </TabItem>
                    <TabItem Header="Finanzen">

                    </TabItem>
                    
                </TabControl>
            </Grid>
        </Grid>
        
    </Grid>
</metro:MetroWindow>
